﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Logoned.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Chowpoo.Util" %>
<%@ Import Namespace="CourseSystem.Common.Chat" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <% var title = ViewData["isCommon"].CheckStr("0") == "1" ? "常见问题库" : "师生问答"; %>
    <%=title%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var title = ViewData["isCommon"].CheckStr("0") == "1" ? "常见问题库" : "师生问答";
       var isCommon = ViewData["isCommon"].CheckInt(0);
    %>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
        <% Html.RenderPartial("TopUc"); %>
        <% Html.RenderPartial("NavUc", 5); %>
        <% Html.RenderPartial("InteractionNavUc", ViewData["type"].CheckInt(0)); %>
    </table>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="200" align="center" valign="top" class="contentBackImg">
                <table width="950" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="28" align="left" background="<%=ResolveUrl("~/Content/images/5_01_1.gif")%>">
                            <table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="22">
                                    </td>
                                    <td width="677">
                                        <div align="left">
                                            <span class="style10"><%=title%></span>
                                        </div>
                                    </td>
                                    <td width="146">
                                        &nbsp;
                                    </td>
                                    <td width="102">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" valign="top" background="<%=ResolveUrl("~/Content/images/5_02_1.gif")%>">
                            <table width="944" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="25" bgcolor="#CCCCCC">
                                        <table width="944" height="25" border="0" cellpadding="0" cellspacing="0">
                                            <% using (Ajax.BeginForm("QuestionListUc", new { isCommon }, new AjaxOptions { UpdateTargetId = "listDiv", HttpMethod = "Get" }))
                                               { %>
                                            <tr>
                                                <td width="107">
                                                    <select id="isAll" name="isAll">
                                                        <option value="0">全部</option>
                                                        <option value="1">我的提问</option>
                                                    </select>
                                                </td>
                                                <td width="67">
                                                    <div align="right" class="style1">
                                                        关键字：
                                                    </div>
                                                </td>
                                                <td width="141">
                                                    <input name="search" type="text" style="width: 130px;" />
                                                </td>
                                                <td width="45">
                                                    <input type="submit" value="搜索" />
                                                </td>
                                                <td width="311">
                                                    &nbsp;
                                                </td>
                                                <td width="295">
                                                    &nbsp;
                                                </td>
                                                <td width="68">
                                                    <%=Html.ActionButton("我要提问","QuestionEdit") %>
                                                </td>
                                                <td width="17">
                                                    &nbsp;
                                                </td>
                                            </tr>
                                            <%} %>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" valign="top" bgcolor="#FFFFFF" id="listDiv">
                                        <% Html.RenderAction("QuestionListUc", new { isCommon }); %>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="13" bgcolor="#FFFFFF">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="3" background="<%=ResolveUrl("~/Content/images/5_04_1.gif")%>">
                        </td>
                    </tr>
                </table>
                <table width="1000" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="10">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div id="movio" style=" color:Red; font-weight:bold; width: 220px; line-height: 37px; height: 37px; z-index: 1;
        position: absolute; background-color: #FBFDD8" onclick="showm();">
        <%=ChatHelper.OnlineChatDic.Count %>个访问此页的人正在聊天,点击参与
    </div>
    <div id="editDiv" title="编辑问题">
    </div>
    <div id="viewDiv" title="查看问题">
    </div>
    <div id="chatDiv" title="在线聊天">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script type="text/javascript">
        var showm2 = function () {
            $("#chatDiv").dialog({
                autoOpen: false,
                height:400,
                width: 450,
                modal: true,
                close: function () {
                }
            });
            $("#chatDiv").html("loading...");
            $("#chatDiv").load(appRoot + 'Interaction/Chat/?trd=' + rdTime());
            $("#chatDiv").dialog("open");
        };
        function showm() {
            window.showModalDialog(appRoot + 'Interaction/Chat/?trd=' + rdTime(), 'newwindow', "dialogWidth:532px,dialogHeight:306px,status:no,resizable:yes");
            // var str = window.showModalDialog(appRoot + 'Interaction/Chat/?trd=' + rdTime(), 'newwindow', 'height=500,   width=600,   top=100,   left= ' + ((screen.availWidth / 2) - 200) + ',   toolbar=0,   menubar=0,   scrollbars=1,   resizable=0,location=0,   status=0 '); 
        }
        $(function () {
            $("#editDiv").dialog({
                autoOpen: false,
                height: 400,
                width: 450,
                modal: true,
                close: function () {
                    window.location.reload();
                }
            });
            $("#viewDiv").dialog({
                autoOpen: false,
                height: 600,
                width: 650,
                modal: true,
                close: function () {
                }
            });

            $("#btnAdd")
                .click(function () {
                    $("#editDiv").html("loading...");
                    $("#editDiv").load(appRoot + 'Interaction/QuestionEditUc/?trd=' + rdTime());
                    $("#editDiv").dialog("open");
                });

        });

        var editClickA = function (id) {
            $("#editDiv").html("loading...");
            $("#editDiv").load(appRoot + 'Interaction/QuestionEditUc/' + id + '?trd=' + rdTime());
            $("#editDiv").dialog("open");
        };

        var viewClickA = function (id) {
            $("#viewDiv").html("loading...");
            $("#viewDiv").load(appRoot + 'Interaction/QuestionViewUc/' + id + '?trd=' + rdTime());
            $("#viewDiv").dialog("open");
        };

    </script>
</asp:Content>
